package com.shop.entity;

import java.util.HashSet;
import java.util.Set;
/*CREATE TABLE member (
  `id` BIGINT(16) NOT NULL auto_increment PRIMARY KEY COMMENT '会员编号（主键）',
  `username` VARCHAR(16) NOT NULL COMMENT '会员用户名',
  `password` VARCHAR(16) NOT NULL COMMENT '会员密码',
  `state` TINYINT(1) COMMENT '会员登录状态'
)ENGINE=INNODB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;*/
/**
 * 
 * <b>会员实体类<b>
 * @author 威 
 * <br>2018年1月3日 下午12:05:18 
 *
 */
public class Member {
	private Integer id;
	private String username;
	private String password;
	private Boolean state;
	private MemberInfor infor;			//关联的个人信息 	1:1
	private Set<Address> address = new HashSet<Address>();			//关联的地址信息 	1:n
	private Set<Order> order = new HashSet<Order>();				//关联的订单	1:n
	private Set<Collection> collection = new HashSet<Collection>();	//关联的收藏	1:n
	private Set<Footprint> footprint = new HashSet<Footprint>();		//关联的足迹	1:n
	private Set<CarGoodsList> carGoodsList = new HashSet<CarGoodsList>();//关联的购车清单	1:n
	
	public Integer getId() {
		return id;
	}

	public void setId(Integer id) {
		this.id = id;
	}

	public String getUsername() {
		return username;
	}

	public void setUsername(String username) {
		this.username = username;
	}

	public String getPassword() {
		return password;
	}

	public void setPassword(String password) {
		this.password = password;
	}

	public Boolean getState() {
		return state;
	}

	public void setState(Boolean state) {
		this.state = state;
	}

	public MemberInfor getInfor() {
		return infor;
	}

	public void setInfor(MemberInfor infor) {
		this.infor = infor;
	}

	public Set<Address> getAddress() {
		return address;
	}

	public void setAddress(Set<Address> address) {
		this.address = address;
	}

	public Set<Order> getOrder() {
		return order;
	}

	public void setOrder(Set<Order> order) {
		this.order = order;
	}

	public Set<Collection> getCollection() {
		return collection;
	}

	public void setCollection(Set<Collection> collection) {
		this.collection = collection;
	}

	public Set<Footprint> getFootprint() {
		return footprint;
	}

	public void setFootprint(Set<Footprint> footprint) {
		this.footprint = footprint;
	}

	public Set<CarGoodsList> getCarGoodsList() {
		return carGoodsList;
	}

	public void setCarGoodsList(Set<CarGoodsList> carGoodsList) {
		this.carGoodsList = carGoodsList;
	}

	public String toString (){
		return "Member[id="+id+
				",username="+username+
				",password="+password+
				",state="+state+
				",inforId="+infor.getId()+
				",addressSize="+address.size()+
				",orderSize="+order.size()+
				",collectionSize="+collection.size()+
				",footprintSize="+footprint.size()+
				",carGoodsListSize="+carGoodsList.size()+"]";
	}
}
